package com.ilancuo.reference;

/**
 * 测试字符串的引用问题
 *
 * Created by ilancuo on 12/03/2017.
 */
public class StrRef {
    public static void main(String[] args) {
        String s = "Hello, World";
        String s1 = "Hello, World";
        System.out.println(s.equals(s1)); //true

        String s2 = new String("Hello, World");
        String s3 = new String("Hello, World");

        String s4 = "Hello, World1";

        System.out.println(s2.equals(s3)); //true
    }
}
